]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
network: Always show primary icon when connected
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 19 May 2016 16:22:02 +0000 (18:22 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Thu, 10 Nov 2016 13:32:07 +0000 (14:32 +0100)
The top bar's network menu only supports a subset of device types
supported by NetworkManager. While not having lesser used options
in the menu itself is perfectly reasonable, not showing any network
icon at all in the top bar when the system is fully connected is
weird.

https://bugzilla.gnome.org/show_bug.cgi?id=773890

js/ui/status/network.js

index c3af481a67c3be028a6b7fa0e174948632c88e3b..2c6d9d899eb99bb156fde1d9f82c8891a721eddc 100644 (file)
@@ -2084,13 +2084,24 @@ const NMApplet = new Lang.Class({
     },
 
     _updateIcon: function() {
-        if (!this._client.networking_enabled || !this._mainConnection) {
+        if (!this._client.networking_enabled) {
             this._primaryIndicator.visible = false;
         } else {
-            let dev = this._mainConnection._primaryDevice;
-            this._primaryIndicator.visible = (dev != null);
-            if (dev)
+            let dev = null;
+            if (this._mainConnection)
+                dev = this._mainConnection._primaryDevice;
+
+            let state = this._client.get_state();
+            let connected = state == NetworkManager.State.CONNECTED_GLOBAL;
+            this._primaryIndicator.visible = (dev != null) || connected;
+            if (dev) {
                 this._primaryIndicator.icon_name = dev.getIndicatorIcon();
+            } else if (connected) {
+                if (this._client.connectivity == NetworkManager.ConnectivityState.FULL)
+                    this._primaryIndicator.icon_name = 'network-wired-symbolic';
+                else
+                    this._primaryIndicator.icon_name = 'network-wired-no-route-symbolic';
+            }
         }
 
         this._vpnIndicator.icon_name = this._vpnSection.getIndicatorIcon();